"""
============================
@auther:多测师-黄sir
@time:2021/9/8:14:04
@email:hw18983616870@163.com
@website:www.duoceshi.cn
============================
"""
from selenium import webdriver
import unittest
from public.base.BasePage import BasePage
from public.utlis.ReadDataIni import *
from public.base.Login_Element import *
class Test_Login(unittest.TestCase):

    def setUp(self) -> None:
        self.driver = webdriver.Chrome()
        BasePage.set_driver(self.driver)
        self.dr = BasePage.get_driver()
        BasePage().open_url(url)
        BasePage().wait(20)
        BasePage().max_window()

    def test_login(self):
        #1.输入用户名
        BasePage().find_ele(username_input)
        BasePage().input(username)
        #2.输入密码
        BasePage().find_ele(pwd_input)
        BasePage().input(pwd)
        # 3.点击登录按钮
        BasePage().find_ele(login_btn)
        BasePage().click_btn()
        # 4.断言登录成功
        BasePage().find_ele(login_on)
        self.value = BasePage().ele_text()
        assert self.value=='在线'

if __name__ == '__main__':
    unittest.main()







